import React from 'react'
import './index.css';
export default class Header extends React.Component {
    mKeyUpData = (event) => {
        if (event.keyCode !== 13) return
        this.props.mKeyUpData(event.target.value)
        this.mInput.value = ''
    }
    render () {
        return (
            <div className="header">
                <input ref={(e) => { this.mInput = e }} className="input-text" type="text" onKeyUp={this.mKeyUpData} placeholder="请输入要添加的任务" />
            </div>
        )
    }
}